package com.pro.service.imple;

import com.pro.mapper.JsBeforeUserShutDownLogMapper;
import com.pro.pojo.JsClosure;
import com.pro.pojo.JsCourse;
import com.pro.service.JsBeforeUserShutDownLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * ClassName:JsBeforeUserShutDownLogServiceImple
 * Package:com.pro.service.imple
 * Description:
 *
 * @Date:2022/1/24 19:46
 * @Author: XJR
 */
@Service
public class JsBeforeUserShutDownLogServiceImple implements JsBeforeUserShutDownLogService {

    @Autowired
    private JsBeforeUserShutDownLogMapper mapper;

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/24
     * @Content:前端用户封停日志列表
     */
    public List<JsClosure> selectBeforeShutDownLog(String account, String reason, Integer type, Integer limit, Integer page){
        page = (page-1)*limit;
        List<JsClosure> jsClosures = mapper.selectBeforeShutDownLog(account, reason, type, limit, page);
        return jsClosures;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/24
     * @Content:前端用户封停日志数量
     */
    public Integer countBeforeShutDownLog(String account,String reason,Integer type){
        Integer integer = mapper.countBeforeShutDownLog(account, reason, type);
        return integer;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/25
     * @Content:前端用户解封日志列表
     */
    public List<JsCourse> selectBeforeUnsealLog(String account,String reason,Integer type,Integer limit,Integer page){
        page = (page-1)*limit;
        List<JsCourse> jsCourses = mapper.selectBeforeUnsealLog(account, reason, type, limit, page);
        return jsCourses;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/25
     * @Content:前端用户解封日志列表
     */
    public Integer countBeforeUnsealLog(String account,String reason,Integer type){
        Integer integer = mapper.countBeforeUnsealLog(account,reason, type);
        return integer;
    };
}
